package pers.vic.blog;

import org.apache.commons.lang3.RandomStringUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalTime;


/**
 *  @description: 启动类
 *  @author Vic.xu
 *  @date: 2020年5月6日下午3:12:43
 */
@SpringBootApplication
@MapperScan(basePackages = "pers.vic.blog.**.mapper")
@EnableScheduling
public class Application {

	 public static void main(String[] args) {
			SpringApplication.run(Application.class, args);
	}


	@RestController
	class Index{
	 	Logger logger = LoggerFactory.getLogger(Index.class);

	 	@GetMapping("ex")
		public String index(){
			logger.info(LocalTime.now() + " " + RandomStringUtils.randomAlphabetic(50) );
	 		throw new RuntimeException("发生了未知的异常");
		}

	}
}
